﻿using OpenTK.Graphics.OpenGL;

namespace OpenGl.Explore.FirstApp
{
    public class VertexArray : OpenglObject, IBindable
    {
        public VertexArray()
        {
            GL.GenVertexArrays(1, out _id);
        }

        public void Bind()
        {
            GL.BindVertexArray(_id);
        }

        public void Unbind()
        {
            GL.BindVertexArray(0);
        }

        protected override void Destory()
        {
            GL.DeleteVertexArrays(1, ref _id);
        }
    }
}
